package com.ruibang.glass.quality.controller;

import com.ruibang.glass.quality.domain.req.DefectLossReq;
import com.ruibang.glass.quality.domain.req.EverydayDefectLossReq;
import com.ruibang.glass.quality.service.EverydayDefectLossService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 每日缺陷损失数据 前端控制器
 * </p>
 *
 * @author wujie
 * @since 2020-08-06
 */
@RestController
@RequestMapping("/api/everyday/loss")
@Api(value="每日缺陷损失数据",tags={"每日缺陷损失数据"})
public class EverydayDefectLossController {

    
    @Autowired
    private EverydayDefectLossService everydayDefectLossService;


    @PostMapping("/queryEverydayDefectLoss")
    @ApiOperation(value="每日缺陷损失数据",notes="每日缺陷损失数据")
    public ResultBody queryEverydayDefectLoss(@RequestBody EverydayDefectLossReq everydayDefectLossReq){
        return everydayDefectLossService.queryEverydayDefectLoss(everydayDefectLossReq);
    }


    @PostMapping("/queryHotLoss")
    @ApiOperation(value="热端损失率",notes="热端损失率")
    public ResultBody queryHotLoss(@RequestBody DefectLossReq defectLossReq){
        return everydayDefectLossService.queryHotLoss(defectLossReq);
    }


    @PostMapping("/queryColdLoss")
    @ApiOperation(value="冷端损失率",notes="冷端损失率")
    public ResultBody queryColdLoss(@RequestBody DefectLossReq defectLossReq){
        return everydayDefectLossService.queryColdLoss(defectLossReq);
    }


    @PostMapping("/queryTotalLoss")
    @ApiOperation(value="总损失率",notes="总损失率")
    public ResultBody queryTotalLoss(@RequestBody DefectLossReq defectLossReq){
        return everydayDefectLossService.queryTotalLoss(defectLossReq);
    }

}
